<%-- 
    Document   : archives_sidebar
    Created on : 10 Jun, 2012, 1:04:17 AM
    Author     : bharat
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.sql.*" %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="./css/maincss.css">
        <link rel="stylesheet" type="text/css" href="./css/myaccountcss.css">
        <title>JSP Page</title>
    </head>
    <body>
        <div>
            <%

                Connection con8 = null;
                PreparedStatement pstmt8 = null;
                ResultSet rs8 = null;

                try {

                    Class.forName("oracle.jdbc.driver.OracleDriver");
                    con8 = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "aksh", "aksh");

                    pstmt8 = con8.prepareStatement("select pid, subject from posts order by dop desc");
                    rs8 = pstmt8.executeQuery();
            %>
            <table>
                <%
                    while (rs8.next()) {
                %>                                      
                <tr><td>
                        <a href="display_post_when_clicked_archives.jsp?pid=<%=rs8.getString(1)%>"><%=rs8.getString(2)%></a>
                    </td></tr>
                    <%
                        }
                    %>
            </table>
            <%

                } catch (Exception e) {
                    response.sendError(505, e.getMessage());
                    e.printStackTrace();
                }

            %>
        </div>
    </body>
</html>
